
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="img/favicon.ico">

    <title>OwlH Master</title>

    <!-- Bootstrap core CSS -->
    <link href="css/dist/css/bootstrap.min.css" rel="stylesheet">

    <!-- fontawesome -->
    <link rel="stylesheet" href="css/fontawesome/css/all.css">

    <!-- Custom styles for this template -->
    <link href="css/offcanvas.css" rel="stylesheet">
  </head>

  <body class="bg-light">

    <nav class="navbar navbar-expand-lg fixed-top navbar-dark bg-dark">
        <img class="mr-3" src="img/owlhblack.png" alt="" height="30"><a class="navbar-brand mr-auto mr-lg-0"
            href="nodes.html"><small>Master </small><i id="menu-title" class="text-warning"></i> | </a>
    
        <!-- <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault"
            aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button> -->
    
        <div class="navbar-collapse offcanvas-collapse" id="navbarsExampleDefault">
            <ul class="navbar-nav mr-auto">
                <li class="nav-item active">
                    <a class="nav-link" href="nodes.html">Nodes</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="groups.html">Groups</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="rulesets.html">Open Rules</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="response.html">Adapt & Response</a>
                </li>
                <!-- <li class="nav-item">
                <a class="nav-link" href="kibana.html">Kibana</a>
                </li> -->
                <li class="nav-item">
                    <a class="nav-link" href="master.html">Master</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="config.html">Config</a>
                </li>
            </ul>
            <p id="current-version-text" class="text-justify text-white">v:</p><p class="text-justify text-white mr-4" id="current-version-show"></p>
        </div>
    </nav>


    <main role="main" class="container">

        <!--Alert-->
        <div id="floating-alert" style="top: 5px;">
        </div>

        <!-- Header banner -->
        <div class="d-flex align-items-center p-3 my-3 text-white-50 bg-low-blue rounded shadow-sm">
            <img class="mr-3" src="img/owlhblack.png" alt="" height="48">
            <div class="lh-100">
                <h3 class="mb-0 text-white lh-100">NIDS nodes</h3>
                <small>Summary</small>
            </div>
        </div>


        <div class="input-group" width="100%" id="search-input-nodes">
            <input class="form-control mx-3 searchInputNodes" type="text" placeholder="Search by name or ip..." aria-label="Search" id="search-node-details">
            <a type="button" class="btn btn-primary mr-2" id="node-search-value"><i class="fas fa-search" style="color: white;"></i></a>
            <a class="btn btn-primary float-right text-decoration-none text-white mr-2" id="add-nid-top" onclick="formAddNids()">Add NIDS Node</a>
        </div><br>

        <!-- GROUPS OPTION
        <div class="text-decoration-none text-primary" style="width:20%; float:right;">
            <a class="nav-link" href="groups.html">Edit groups</a>            
        </div>
        <br><br> -->

        <div class="container" id="nodes-table">
        </div>
     
        <!-- <small class="text-decoration-none text-white" style="width:20%; float:right;">
            <a class="btn btn-primary float-right" id="addnids" onclick="formAddNids()">Add NIDS</a>
        </small> -->
        <a class="btn btn-primary float-right text-decoration-none text-white" id="add-nid-bottom" onclick="formAddNids()">Add NIDS Node</a>
        <br><br>
        <div class="container" style="display: none" id="nidsform">
            <form id="nodedetails">
                <div class="form-row" id="">
                    <div class="form-group col-md-6">
                        <div class="input-group mb-2 mr-sm-2 mb-sm-0">
                            <div class="input-group-prepend">
                                <span class="input-group-text wt-125">Node Name</span>
                            </div>
                            <input type="text" class="form-control" id="nodename" placeholder="node-name" required>
                        </div>
                    </div>
                </div>
                <div class="form-row">
                    <div class="form-group col-md-6">
                        <div class="input-group mb-2 mr-sm-2 mb-sm-0">
                            <div class="input-group-prepend">
                                <span class="input-group-text wt-125">Node IP</span>
                            </div>
                            <input type="text" class="form-control" id="nodeip" placeholder="x.x.x.x" required>
                        </div>
                    </div>
                    <div class="form-group col-md-6">
                        <div class="input-group mb-2 mr-sm-2 mb-sm-0">
                            <div class="input-group-prepend">
                                <span class="input-group-text wt-125">Node Port</span>
                            </div>
                            <input type="text" class="form-control" id="nodeport" placeholder="50002" required>
                        </div>
                    </div>
                </div>

                <div class="text-right">
                    <button type="button" class="btn btn-primary" style="float: right;" onclick="addNode()">Add</button>
                </div>
                <br><br>
            </form>
        </div>
    
        <!--Show the form for modify node information(IP, nid and port)-->
        <div class="container" style="display: none; width:100%" id="divconfigform">
            <form id="configform">
                <div class="form-row">
                    <div class="form-group col-md-6">
                        <div class="input-group mb-2 mr-sm-2 mb-sm-0">
                            <div class="input-group-prepend">
                                <span class="input-group-text wt-125">Node Name</span>
                            </div>
                            <input type="text" class="form-control" id="cfgnodename" placeholder="node-name" required>
                        </div>
                    </div>
                </div>
                <div class="form-row">
                    <div class="form-group col-md-6">
                        <div class="input-group mb-2 mr-sm-2 mb-sm-0">
                            <div class="input-group-prepend">
                                <span class="input-group-text wt-125">Node IP</span>
                            </div>
                            <input type="text" class="form-control" id="cfgnodeip" placeholder="x.x.x.x" required>
                        </div>
                    </div>
                    <div class="form-group col-md-6">
                        <div class="input-group mb-2 mr-sm-2 mb-sm-0">
                            <div class="input-group-prepend">
                                <span class="input-group-text wt-125">Node Port</span>
                            </div>
                            <input type="text" class="form-control" id="cfgnodeport" placeholder="50002" required>
                            <input type="hidden" class="form-control" id="cfgnodeid" placeholder="50002" required>
                        </div>
                    </div>
                </div>
    
                <div style="float:right;">
                    <tr>
                        <a class="btn btn-primary float-right text-white" style="margin-left:10px;" onclick="modifyNodeInformation()">Modify</a>
                        <a class="btn btn-secondary float-right text-white" style="margin-left:10px;" onclick="cancelNodeModification()">Cancel</a>
                    </tr>
                </div>
            </form>            
        </div>
    
        <!-- Footer -->
        <div id="footer"></div>

        <!-- Modal -->
        <div class="modal fade" id="modal-window">
        </div>
        <div class="modal fade" id="modal-window-delete">
        </div>
    
        <!-- Load master ip/port -->
        <div id="load-json-data" style="display: none;">
            <input id="ip-master" type="text" class="form-control">
            <input id="port-master" type="text" class="form-control">
        </div>
    
    </main>

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="js/axios/dist/axios.js"></script> 
    <script src="js/jquery-3.4.1.js"></script>
    <script src="css/dist/js/bootstrap.min.js"></script>
    <script src="js/offcanvas.js"></script>
    <script src="js/node/dataflow.js"></script>
    <script src="js/owlh.js"></script>
    <script src="js/node.js"></script>
    <script src="js/footer.js"></script>
    <script src="js/loadTitle.js"></script>
  </body>
</html>

